import threading
import time


def worker():
    # 打印当前线程的名称
    t = threading.current_thread()
    time.sleep(5)
    print(t.getName())


# 主线程
t = threading.current_thread()
print(t.getName())

# 在主线程下添加一个子线程
new_t = threading.Thread(target=worker, name='Test Thread')
# 启动线程
new_t.start()
